package net.lb.io.json;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class Data
{
    private String                             name   = "linbin";
    private boolean                            result = false;
    private int                                age    = 26;
    private Date                               date   = new Date();
    private int[]                              a      = new int[] { 1, 2, 3 };
    private ArrayList<String>                  b      = new ArrayList<>();
    private int[][]                            c      = new int[][] { { 1, 2 }, { 3, 4, 5 } };
    private HashMap<String, Person>            map    = new HashMap<>();
    private HashMap<String, String>            enpty  = new HashMap<>();
    private ArrayList<HashMap<String, Person>> list   = new ArrayList<HashMap<String,
                                                              Person>>();
    
    public Data()
    {
        b.add("dasdasd");
        b.add("dsadadasda");
        map.put("linbin", new Person());
        list.add(map);
    }
    
    public static void main(String args[]) throws NoSuchFieldException, SecurityException
    {
        Type type = Data.class.getDeclaredField("list").getGenericType();
        System.out.println(Map.class.isAssignableFrom(type.getClass()));
        ParameterizedType parameterizedType = (ParameterizedType) Data.class.getDeclaredField("list").getGenericType();
        parameterizedType = (ParameterizedType) parameterizedType.getActualTypeArguments()[0];
        System.out.println(parameterizedType instanceof ParameterizedType);
    }
    
    public int[][] getC()
    {
        return c;
    }
    
    public void setC(int[][] c)
    {
        this.c = c;
    }
    
    public HashMap<String, String> getEnpty()
    {
        return enpty;
    }
    
    public void setEnpty(HashMap<String, String> enpty)
    {
        this.enpty = enpty;
    }
    
    public String getName()
    {
        return name;
    }
    
    public void setName(String name)
    {
        this.name = name;
    }
    
    public boolean isResult()
    {
        return result;
    }
    
    public void setResult(boolean result)
    {
        this.result = result;
    }
    
    public int getAge()
    {
        return age;
    }
    
    public void setAge(int age)
    {
        this.age = age;
    }
    
    public Date getDate()
    {
        return date;
    }
    
    public void setDate(Date date)
    {
        this.date = date;
    }
    
    public int[] getA()
    {
        return a;
    }
    
    public void setA(int[] a)
    {
        this.a = a;
    }
    
    public ArrayList<String> getB()
    {
        return b;
    }
    
    public void setB(ArrayList<String> b)
    {
        this.b = b;
    }
    
    public HashMap<String, Person> getMap()
    {
        return map;
    }
    
    public void setMap(HashMap<String, Person> map)
    {
        this.map = map;
    }
    
    public ArrayList<HashMap<String, Person>> getList()
    {
        return list;
    }
    
    public void setList(ArrayList<HashMap<String, Person>> list)
    {
        this.list = list;
    }
    
}
